listbox: Add gtk_list_box_remove
authorMatthias Clasen <mclasen@redhat.com>
Fri, 8 May 2020 05:50:37 +0000 (01:50 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 12 May 2020 02:21:39 +0000 (22:21 -0400)
This is a gtk_container_remove replacement.

docs/reference/gtk/gtk4-sections.txt
gtk/gtklistbox.c
gtk/gtklistbox.h

index 22d212a8873ba4492c71c96882fa4020f2106932..aec527c5baaf555a7556287a70cb4339cdfa7ef2 100644 (file)
@@ -274,6 +274,7 @@ GtkListBoxUpdateHeaderFunc
 gtk_list_box_new
 gtk_list_box_prepend
 gtk_list_box_insert
+gtk_list_box_remove
 gtk_list_box_select_row
 gtk_list_box_unselect_row
 gtk_list_box_select_all
index 6068c5334e503e375011fdf9e6132c3888bae0db..74a413ffb16fc216a0c16e3711752eb5b5fdb9b5 100644 (file)
@@ -250,8 +250,6 @@ static GtkListBoxRow       *gtk_list_box_get_first_focusable          (GtkListBo
 static GtkListBoxRow       *gtk_list_box_get_last_focusable           (GtkListBox          *box);
 static void                 gtk_list_box_add                          (GtkContainer        *container,
                                                                        GtkWidget           *widget);
-static void                 gtk_list_box_remove                       (GtkContainer        *container,
-                                                                       GtkWidget           *widget);
 static void                 gtk_list_box_forall                       (GtkContainer        *container,
                                                                        GtkCallback          callback,
                                                                        gpointer             callback_target);
@@ -2270,12 +2268,18 @@ gtk_list_box_add (GtkContainer *container,
   gtk_list_box_insert (GTK_LIST_BOX (container), child, -1);
 }
 
-static void
-gtk_list_box_remove (GtkContainer *container,
+/**
+ * gtk_list_box_remove:
+ * @box: a #GtkListBox
+ * @child: the child to remove
+ *
+ * Removes a child from @box.
+ */
+void
+gtk_list_box_remove (GtkListBox   *box,
                      GtkWidget    *child)
 {
-  GtkWidget *widget = GTK_WIDGET (container);
-  GtkListBox *box = GTK_LIST_BOX (container);
+  GtkWidget *widget = GTK_WIDGET (box);
   gboolean was_visible;
   gboolean was_selected;
   GtkListBoxRow *row;
index 57f26f8c3bda3427ff5250de8ae1e875f16859cd..ddeb62b6ab060e7c3410469570662d9e4059e5bc 100644 (file)
@@ -172,6 +172,9 @@ void           gtk_list_box_insert                       (GtkListBox
                                                           GtkWidget                     *child,
                                                           gint                           position);
 GDK_AVAILABLE_IN_ALL
+void           gtk_list_box_remove                       (GtkListBox                    *box,
+                                                          GtkWidget                     *child);
+GDK_AVAILABLE_IN_ALL
 GtkListBoxRow* gtk_list_box_get_selected_row             (GtkListBox                    *box);
 GDK_AVAILABLE_IN_ALL
 GtkListBoxRow* gtk_list_box_get_row_at_index             (GtkListBox                    *box,